package org.example.alig;

import java.util.Arrays;

public class Alig5 {
    public static void main(String[] args) {
        int datas[] = {1, 4, 0, 6, 0, 7, 0, 9};
        int l = 0;
        int length = datas.length;
        for (int r = 0; r < length; r++) {
            if (datas[r] == 0) continue;
            datas[l++] = datas[r];
        }
        for (; l < length; l++) {
            datas[l] = 0;
        }
        System.out.println(Arrays.toString(datas));
    }
}
